package com.xxs.controller.admin;

import com.jfinal.core.Controller;
import com.xxs.model.Admin;

/**
 * Created with IntelliJ IDEA.
 */
//@Before(AdminInterceptor.class)
public class AdminController extends Controller {
    public void index(){
    	render("common/common.ftl");
    }
    public void main(){
    	render("common/main.ftl");
    }
    public void list(){
    	setAttr("page", Admin.dao.getPageForAdmin(getParaToInt(0, 1)));
    	render("admin/list.ftl");
    }
    public void edit(){
    	Admin bean = Admin.dao.findById(getParaToInt(0));
    	setAttr("bean", bean);
    	render("admin/edit.ftl");
    }
    public void update(){
    	getModel(Admin.class).myUpdate();
        list();
    }
}
